package com.shayne.demo;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.ListView;

import java.util.ArrayList;
import java.util.List;

public class MainActivity extends AppCompatActivity {

    private List<User> users = new ArrayList<User>();
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        init();
        MyAdapter adapter = new MyAdapter(MainActivity.this,R.layout.item,users);
        ListView listView = (ListView) findViewById(R.id.list_view);
        listView.setAdapter(adapter);

    }
    private void init(){
        for (int i = 0; i < 40; i++) {
            User user = new User("Test",R.mipmap.ic_launcher);
            users.add(user);
        }
    }

}
